package cn.fengzhilun.javase.day07;

import java.util.Objects;

public class Employee {
	private String name;
	private int age;
	private char gender;
	public Employee() {
		System.out.println("员工初始化 ");
	}
	public Employee(String name) {
		System.out.println("员工代参数构造器被调用");
		this.name=name;
		
	}
	
	private double salary;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public double getSalary() {
		return salary;
	}

	public void setSalary(double salary) {
		this.salary = salary;
	}
	
	public boolean equals(Object obj) {
		
		if(this== obj) {
			return true;
			
		}
		
		if(!(obj instanceof Employee)) {
			
			return false;
		}
		
		Employee other=(Employee)obj;
		
		if(this.age!=other.age) {
			
			return false;
			
		}
		
		if(this.age!=other.age) {
			
			return false;
		}
		if(this.gender!=other.gender)
		{
			
		return false;
		}
	
		if(!Objects.equals(this.name,other.name)) {
			
			return false;
		}
		return true;
	}
}
